home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 13
/
AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso
/
rexx
/
selectdoc.bed
< prev
next >
Wrap
Text File
|
1997-12-03
|
869b
|
56 lines
/*
** $VER: SelectDoc.bed 1.0 (02.01.96)
**
** Shows a list of the documents currently loaded in Blacks Editor and
** asks for the number of the document to be activated.
**
** Written by Neil Lucking
** Modified by Martin Taillefer
** Modified by Marco Negri
*/
OPTIONS RESULTS
OPTIONS PROMPT "Select document > "
OPTIONS FAILAT 21
PARSE ARG name
ADDRESS BED
IF name = "" THEN DO
GetDocuments
docs = RESULT
SAY "Available documents:"
i=1
DO WHILE docs ~= ""
PARSE VAR docs '"'file'"' file.i docs
IF file = "" THEN file = "Untitled"
SAY ' ' i ':' file
i = i+1
END
IF i=1 THEN DO
SAY "No documents loaded"
RETURN
END
PULL n
IF n = "" THEN RETURN
ADDRESS VALUE file.n
END; ELSE DO
GetPort name
ADDRESS VALUE RESULT
END
IF RC = 0 THEN DO
Screen2Front
IconifyWindow OFF
ActivateWindow FRONT
END; ELSE DO
SAY "Document not found"
END